<?php defined("SYSPATH") or die("No direct script access.");


/**
* @author Kami Vaniea (Carnegie Mellon University)
*/

class audit_log_installer {
  static function install() {
    $db = Database::instance();
    $db->query("CREATE TABLE IF NOT EXISTS {audit_logs} (
                 `id` int(9) NOT NULL auto_increment,
                 `item_id` int(9) NOT NULL,
                 `user_id` int(9) NOT NULL,
                 `action`  varchar(64) NOT NULL,
                 `timestamp` int(9) NOT NULL,
                 `comment` varchar(256) NULL,
                 PRIMARY KEY (`id`),
                 UNIQUE KEY(`id`))
               DEFAULT CHARSET=utf8;");

    module::set_version("audit_log", 2);
  }

  static function upgrade($version) {
   
  }

  static function uninstall() {
    $db = Database::instance();
    $db->query("DROP TABLE IF EXISTS {audit_logs};");

  }
}
